home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / etc / cron.weekly / sysklogd < prev   
Encoding:
Text File  |  2006-10-06  |  1.1 KB  |  39 lines

  1. #! /bin/sh
  2.  
  3. # sysklogd    Cron script to rotate system log files weekly.
  4. #
  5. #        If you want to rotate logfiles daily, edit
  6. #        this script and /etc/cron.daily/sysklogd to get
  7. #        the logfiles in sync (they must not occur in both
  8. #        files).
  9. #
  10. #        This is a configration file.  You are invited to edit
  11. #        it and maintain it on your own.  You'll have to do
  12. #        that if you don't like the default policy
  13. #        wrt. rotating logfiles (i.e. with large logfiles
  14. #        weekly and daily rotation may interfere).  If you edit
  15. #        this file and don't let dpkg upgrade it, you have full
  16. #        control over it.  Please read the manpage to
  17. #        syslogd-listfiles.
  18. #
  19. #        Written by Ian A. Murdock <imurdock@debian.org>.
  20. #        $Id: cron.weekly,v 1.10 2004-03-31 16:18:15 joey Exp $
  21.  
  22. test -x /usr/sbin/syslogd-listfiles || exit 0
  23. test -x /sbin/syslogd || exit 0
  24. test -f /usr/share/sysklogd/dummy || exit 0
  25.  
  26. set -e
  27.  
  28. cd /var/log
  29. for LOG in `syslogd-listfiles --weekly`
  30. do
  31.    if [ -s $LOG ]; then
  32.       savelog -g adm -m 640 -u root -c 4 $LOG >/dev/null
  33.    fi
  34. done
  35.  
  36. # Restart syslogd
  37. #
  38. /etc/init.d/sysklogd reload-or-restart > /dev/null
  39.